package com.csu54sher.basereservation.exception;

import com.csu54sher.basereservation.enums.ResultCode;
import lombok.Getter;

/**
 * 业务异常（登录、用户操作等场景）
 */
@Getter
public class BusinessException extends RuntimeException {
    private final Integer code;

    public BusinessException(Integer code, String message) {
        super(message);
        this.code = code;
    }

    public BusinessException(String message) {
        this(500, message);
    }

    public BusinessException(ResultCode resultCode) {
        this(resultCode.getCode(), resultCode.getMessage());
    }
}